package test1225;

public class Test11 {
    public static void main(String[] args) {
        // 返回2个数组的交集
        int[] arr = {1,2,3,4,5};
        int[] brr = {3,4,5,6,7};
        int[] crr = m11(arr, brr);
        for (int c:crr) {
            System.out.println(c);
        }
    }
    public static int[] m11(int[] arr, int[] brr) {
        int n = arr.length;
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < brr.length; j++) {
                if (arr[i] == brr[j]) {
                    arr[i] = 0;
                    brr[j] = 0;
                }
            }
        }
        return new int[n];
    }
}

